From 8c5464dd34090c82c49da62bfb571dffa02fba06 Mon Sep 17 00:00:00 2001 From: "kaf24@freefall.cl.cam.ac.uk" Date: Thu, 9 Sep 2004 01:20:13 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.144 (413fafcd5CFNlwHKLUYzorp_LsbEKA) Fix writable-pagetable initialisation. --- xen/arch/x86/memory.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index 57cc589f75..640181a6cc 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -144,7 +144,6 @@ static struct domain *dom_xen, *dom_io; void arch_init_memory(void) { unsigned long mfn; - int i; /* * We are rather picky about the layout of 'struct pfn_info'. The @@ -198,15 +197,6 @@ void arch_init_memory(void) frame_table[mfn].u.inuse.type_info = PGT_gdt_page | 1; /* non-RW */ frame_table[mfn].u.inuse.domain = dom_xen; } - - vm_assist_info[VMASST_TYPE_writable_pagetables].enable = NULL; - vm_assist_info[VMASST_TYPE_writable_pagetables].disable = NULL; - - for ( i = 0; i < smp_num_cpus; i++ ) - { - ptwr_info[i].disconnected_page = (void *)alloc_xenheap_page(); - ptwr_info[i].writable_page = (void *)alloc_xenheap_page(); - } } static void __invalidate_shadow_ldt(struct domain *d) @@ -1876,6 +1866,20 @@ int ptwr_do_page_fault(unsigned long addr) return 0; } +static __init int ptwr_init(void) +{ + int i; + + for ( i = 0; i < smp_num_cpus; i++ ) + { + ptwr_info[i].disconnected_page = (void *)alloc_xenheap_page(); + ptwr_info[i].writable_page = (void *)alloc_xenheap_page(); + } + + return 0; +} +__initcall(ptwr_init); + #ifndef NDEBUG void ptwr_status(void) { -- 2.30.2